let obj1 ={
    name:'fd',
    arr:[1,[2,3],4]
}
function shallowClone(source) {
    var target = {};
    for(var i in source) {
        if (source.hasOwnProperty(i)) {
            target[i] = source[i];
        }
    }
    return target;
}
let obj2 = JSON.parse(JSON.stringify(obj1))
let obj2 = obj1
obj2.name = 'z[k'
//浪费内存
// js 内存优化的需要，复杂数据，默认引用式赋值